How to evaluate logarithm